<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // 当其他对象使用instanceof运算符，判断是否为该对象的实例时，会调用这个方法
// class Even {
//   static [Symbol.hasInstance](obj) {
//     return Number(obj) % 2 === 0;
//   }
// }

// // 等同于
// const Even = {
//   [Symbol.hasInstance](obj) {
//     return Number(obj) % 2 === 0;
//   }
// };

// 1 instanceof Even // false
// 2 instanceof Even // true
// 12345 instanceof Even // false

const arr = [1,2,3];
const arr2 = [4,5,6];
arr2[Symbol.isConcatSpreadable] = false;//不可展开
console.log(arr.concat(arr2));


    </script>
</body>
</html>